<div id="page-wrapper" class="animated marg220">
<div class="page-t">
  <div class="page-nav">
    <a  href="javascript:;">设备管理</a>
    <a  routerLinkActive="active" >设备状态</a>
  </div>
  <router-outlet></router-outlet>
  <div class="search-box col-sm-12">
    <div id="search-box">
      <div class="input-group">
        <input #searchBox type="text" placeholder="请输入设备ID" class="input-sm form-control"> <span class="input-group-btn">
                                        <button type="button" class="btn btn-sm btn-primary" (click)="search(searchBox.value)"> 搜索</button> </span>
      </div>
    </div>

      <!--<a onclick="fnClickAddRow();" href="javascript:void(0);" class="btn btn-primary fn-right">返回</a>-->

    <!--<electricity-search></electricity-search>-->
  </div>

</div>
<div class="J_mainContent" id="content-main">
  <div class="wrapper wrapper-content">
    <!--<track-map></track-map>-->
    <div class="xt-list xt-list5 xt-list15">

      <table class="table table-striped">
        <thead>
        <tr>
          <th >
            序号
          </th>
          <th>
            设备ID
          </th>
          <th>
            设备状态
          </th>
          <th>
            位置
          </th>
          <th>
            电量
          </th>
          <th>
            在线时间
          </th>
          <th>
            轨迹
          </th>
        </tr>
        </thead>
        <tbody>
        <tr *ngFor="let electricity of electricities; let i = index;"  (click)="onSelect(electricity)">
          <td>{{(curPage-1)*10+i+1}}</td>
          <td >{{electricity.deviceIMEI}}</td>
          <td >{{electricity.deviceStatus}}</td>
          <td>{{electricity.locationType}}({{electricity.locationLongitude}},{{electricity.locationLatitude}})</td>
          <td >{{electricity.locationPower}}%</td>
          <td >{{electricity.onlineTime}}</td>
          <td>&nbsp;&nbsp;
            <a (click)="gotoDetail(electricity)" >轨迹详情</a>&nbsp;&nbsp;&nbsp;&nbsp;
          </td>
        </tr>
        </tbody>
      </table>
    </div>
    <div style="position:relative;padding:0 30px;top:0">
      <!--分页组件-->
      <div class="col-md-12 text-right margin-bottom mt25" *ngIf="electricities&&!isSearch">
        <a class="pull-left text-sm wordHei">总计 {{totalNum}} 条，第 {{curPage}} / {{totalPage}} 页</a>

        <button class="btn btn-default next"  (click)="changePage(curPage-1)"
                [disabled]="curPage==1">上一页</button>
        <button class="btn btn-default"   [ngClass]="x.isActive?'btn-primary':'btn-oprate'"
                (click)="changePage(x.pageNum)"  *ngFor="let x of pageList;let i = index;">
          {{x.pageNum}}
        </button>
        <button class="btn btn-default next"  (click)="changePage(curPage+1)"
                [disabled]="curPage==totalPage">下一页</button>
      </div>
      <div class="col-md-12 text-center text-sm text-dark-gray mt10" *ngIf="isEmpty">
        没有查询到数据
      </div>
    </div>
  </div>
  </div>
</div>

